<template>
  <div class="app-container">

    <el-container>
      <el-header>
        <el-row :gutter="1">
          <el-col :span="12">
            项目：
            <el-select
              v-model="project_id"
              v-loading="projectsLoading"
              placeholder="项目"
              filterable
              size="mini"
              clearable
            >
              <el-option
                v-for="item in projects"
                :key="item.id"
                :label="item.name"
                :value="item.id"
              />
            </el-select>
            WP网站：
            <single_wpaccount_select :wpaccount_id="wp_account_id" size="small" @change="changeWPAccount" />
            完成状态：
            <el-select v-model="is_finshed" size="mini" placeholder="完成" clearable>
              <el-option label="所有" value="" />
              <el-option label="已经完成" value="finished" />
              <el-option label="没有完成" value="unfinished" />
              <el-option label="失败" value="failed" />
            </el-select>
          </el-col>
          <el-col :span="12">
            <el-row :gutter="20">
              <el-col :span="12">
                <el-input
                  v-model="kwInput"
                  size="mini "
                  placeholder="输入关键词进行筛选"
                  class="input-with-select"
                  clearable
                  @keyup.native.enter="handleSearch"
                >
                  <el-button slot="append" size="mini" icon="el-icon-search" @click="handleSearch">搜索</el-button>
                </el-input>
              </el-col>
              <el-col :span="12">
                <el-button
                  size="mini"
                  type="success"
                  title="添加关键词"
                  icon="el-icon-plus"
                  @click="handleAction('create', '')"
                >添加词
                </el-button>
                <el-button
                  v-if="selected_rows.length"
                  size="mini"
                  type="warning"
                  title="重新爬取选择"
                  icon="el-icon-plus"
                  @click="handleDeleteSelections"
                >重新爬取
                </el-button>
              </el-col>
            </el-row>
          </el-col>
        </el-row>
      </el-header>
      <el-container>

        <el-main>
          <el-table
            v-loading.body="listLoading"
            :data="data"
            border
            fit
            highlight-current-row
            :default-sort="{prop: 'create_at', order: 'descending'}"
            style="width: 100%"
            @sort-change="handleSort"
            @selection-change="handleSelectionChange"
          >
            <el-table-column
              type="selection"
              width="55"
            />
            <el-table-column align="left" label="来源" width="200" prop="plantform" sortable="custom" />
            <el-table-column align="center" label="关键词" prop="keyword" sortable="custom">
              <template slot-scope="scope">
                <a target="_blank" :href="'https://www.amazon.com/s?language=en_US&k=' + scope.row.keyword">{{ scope.row.keyword }}</a>
              </template>
            </el-table-column>
            <el-table-column align="center" label="完成进度" prop="post_list">
              <template slot-scope="scope">
                <ul class="infinite-list" style="overflow:auto">
                  <li v-for="i in scope.row.post_list" class="infinite-list-item">
                    <a v-if="i.post_sended" :href="i.target_post_link">{{ i.domain + '|' + i.target_post_id + i.md5_filename }}</a>
                    <span v-else-if="i.crawl_count >= 3">{{ '爬取失败: ' + i.domain }}</span>
                    <span
                      v-else
                    >{{ 'not finishe yet: ' + i.domain }}</span>
                    <el-popover
                      placement="top-start"
                      :title="i.domain"
                      width="400"
                      trigger="hover"
                    >
                      <div>
                        <p>URL: <el-link type="danger" :href="i.target_post_link" target="_blank">{{ i.target_post_link }}</el-link></p>
                        <p>MD5: {{ i.md5_filename }}</p>
                        <p>post ID: {{ i.target_post_id }}</p>
                        <p>目录: {{ i.id_of_associated_categories }}</p>
                        <p>feature image: {{ i.default_fature_media_id }}</p>
                        <p>feature image url: {{ i.feature_image_url }}</p>
                        <p>target_post_id: {{ i.target_post_id }}</p>
                        <p>优先级:  <el-rate v-model="i.star" /></p>
                        <div style="display: block">
                          外链
                          <ul>
                            <li v-for="(item,index) in i.out_links" :key="index">
                              {{ item.link }} 锚文本:{{ item.anchor }}
                            </li>
                          </ul>
                        </div>
                        <p>crawl_count:{{ i.crawl_count }}</p>
                      </div>
                      <i slot="reference" class="el-icon-info" />
                    </el-popover>
                    <el-button size="mini" type="text" icon="el-icon-edit" @click="handleEditKeywordPost(i)" />
                  </li>
                </ul>
              </template>
            </el-table-column>
            <el-table-column align="center" label="添加人" prop="owner_name" width="210" sortable="custom" />
            <el-table-column align="center" label="最后更新" prop="update_at" sortable="update_at" width="180px" />
            <el-table-column align="center" label="操作" width="200">
              <template slot-scope="scope">
                <el-button size="mini" type="warning" plain @click="handleAction('edit', scope.row)">修改</el-button>
                <el-button
                  size="mini"
                  icon="el-icon-refresh"
                  type="danger"
                  plain
                  @click="handleAction('delete', scope.row)"
                >删除
                </el-button>
              </template>
            </el-table-column>
          </el-table>
          <el-pagination
            v-if="data.length"
            background
            class="mt-pagination"
            :current-page="page"
            :page-sizes="[10,20,50,100]"
            :page-size="pagesize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
            @size-change="handleSizeChange"
            @current-change="handlePageChange"
          />
        </el-main>
      </el-container>
    </el-container>
    <el-dialog
      :title="title"
      :visible.sync="crawlkeywordDialogVisible"
      :width="width"
      :close-on-click-modal="false"
      style="margin-top: 10px !important;"
    >
      <el-form ref="dataForm" :model="FormTemp" label-position="left" label-width="140px">
        <el-form-item label="来源">
          <el-input v-model="FormTemp.plantform" />
        </el-form-item>
        <el-form-item v-if="action === 'create'" label="keywords">
          <el-input v-model="FormTemp.keywords" placeholder="多个关键词换行" type="textarea" rows="10" />
          <el-button type="default" @click="removeKeywords">过滤短词</el-button>
        </el-form-item>
        <el-form-item v-else label="keyword">
          <el-input v-model="FormTemp.keyword" placeholder="关键词" />
        </el-form-item>
        <el-form-item v-if="action === 'create'" label="优先级">
          <el-rate v-model="FormTemp.star" />
        </el-form-item>
        <el-form-item v-if="action !== 'create'" label="is_finshed">
          <el-switch
            v-model="FormTemp.is_finshed"
            active-color="#13ce66"
            inactive-color="#ff4949"
          />
        </el-form-item>
        <el-form-item v-if="action !== 'create'" label="post_count">
          <el-input v-model="FormTemp.post_count" />
        </el-form-item>
        <el-form-item v-if="action === 'create'" label="外链">
          <ul>
            <li v-for="(item,index) in FormTemp.out_links" :key="index">
              {{ item.link }} 锚文本:{{ item.anchor }}
            </li>
          </ul>
          <el-button type="text" @click="addlink(null)">添加外链</el-button>
          <el-button type="text" @click="handleCleanTempOutLinks">清空</el-button>

        </el-form-item>

        <el-form-item v-if="action === 'create'" label="目标网站">
          <single_wpaccount_select :wpaccount_id="FormTemp.wpaccount_id" size="small" @change="changeTempWpAccount" />
        </el-form-item>
        <el-form-item v-if="action === 'create'" label="目录ID">
          <div v-if="FormTemp.wpaccount_id" class="content">
            <wpcategory :account_id="FormTemp.wpaccount_id" />
          </div>
          <el-input v-model="FormTemp.id_of_associated_categories" placeholder="多个目录用,号分隔" />
        </el-form-item>
        <el-form-item v-if="action === 'create'" label="feature image id">
          <el-input v-model="FormTemp.default_fature_media_id" placeholder="输出站内图片ID" />
        </el-form-item>
        <el-form-item v-if="action === 'create'" label="外部图片">
          <el-input v-model="FormTemp.feature_image_url" placeholder="输入图片URL" />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="crawlkeywordDialogVisible = false">取 消</el-button>
        <el-button type="danger" :loading="formloading" @click="confirm">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      title="添加外链"
      :visible.sync="addlinkDialogVisible"
      :close-on-click-modal="false"
      width="30%"
    >
      link:<el-input v-model="temp_link.link" /><br>
      anchor<el-input v-model="temp_link.anchor" />
      <span slot="footer" class="dialog-footer">
        <el-button @click="addlinkDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="handleAddLink">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog
      :title="operate_item.id"
      :visible.sync="editKeywordPostDialog"
      :close-on-click-modal="false"
      width="80%"
      style="margin-top: 10px !important;"
    >
      <el-form ref="dataForm" :model="operate_item" label-position="left" label-width="140px">
        <el-form-item label="category_ids">
          <el-input v-model="operate_item.id_of_associated_categories" placeholder="id_of_associated_categories" />
        </el-form-item>
        <el-form-item label="优先级">
          <el-rate v-model="operate_item.star" />
        </el-form-item>
        <el-form-item label="amz_tag">
          <el-input v-model="operate_item.amazon_promote_tag" />
        </el-form-item>
        <el-form-item label="media_id">
          <el-input v-model="operate_item.default_fature_media_id" />
        </el-form-item>
        <el-form-item label="feature_image_url">
          <el-input v-model="operate_item.feature_image_url" />
        </el-form-item>
        <el-form-item label="crawl_count">
          <el-input v-model="operate_item.crawl_count" />
        </el-form-item>
        <el-form-item label="post_sended">
          <el-switch
            v-model="operate_item.post_sended"
            active-color="#13ce66"
            inactive-color="#ff4949"
          />
        </el-form-item>
        <el-form-item label="外链">
          <ul>
            <li v-for="(item,index) in operate_item.out_links" :key="index">
              {{ item.link }} 锚文本:{{ item.anchor }}
            </li>
          </ul>
          <el-button type="text" @click="addlink">添加外链</el-button>
          <el-button type="text" @click="handleCleanTempOutLinks">清空</el-button>
        </el-form-item>
      </el-form>

      <span slot="footer" class="dialog-footer">
        <el-button @click="editKeywordPostDialog = false">取 消</el-button>
        <el-button type="danger" @click="handleModifyKW(operate_item)">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { Get as GetProjects } from '@/api/erp/elicink/project'
import { Get as GetWebs } from '@/api/cms/wpaccount'
import { Post, Get as GetCrawlKeyword, Delete, Put } from '@/api/cms/crawlkeyword'
import { Put as ModifyKeywordPost } from '@/api/cms/searchkeypostweb'
import { Get as GetUsers } from '@/api/users'
import wpcategory from '@/views/cms/elements/wpcategory'
import wpaccount from '@/views/cms/elements/wpaccount'
import qs from 'qs'

const orderMapper = {
  'ascending': 0,
  'descending': 1,
  'null': ''
}

import Cookies from 'js-cookie'
import Single_wpaccount_select from './elements/single_wpaccount_select'

const ProjectKey = 'cms_project_id__search'
const StrotegyKey = 'cms_strategy_id__search'
const TopicKeywordKey = 'cms__keyword__search'
const OwnerKey = 'cms_language_id__owner'

export function getToken(key) {
  const v = Cookies.get(key)
  return v && parseInt(v) || null
}

export function getTokenStr(key) {
  const v = Cookies.get(key)
  return v || null
}

export function setToken(key, value) {
  if (value) {
    return Cookies.set(key, value)
  }
}

export default {
  components: { Single_wpaccount_select, wpaccount, wpcategory },
  data() {
    return {
      selected_rows: [],
      formloading: false,
      action: '',
      width: '80%',
      title: '添加新关键词',
      is_finshed: '',
      wp_account_id: '',
      webs: [],
      topicEditId: '',
      crawlkeywordDialog: '添加新话题',
      crawlkeywordDialogVisible: false,
      directoryVisable: false,
      FormTemp: {
        keywords: '',
        plantform: 'https://www.amazon.com',
        star: 1,
        out_links: [],
        wpaccount_id: '',
        default_fature_media_id: '',
        feature_image_url: '',
        id_of_associated_categories: ''
      },
      temp_link: {
        link: '',
        anchor: ''
      },
      listLoading: false,
      webVisible: false,
      projects: [],
      project_id: null,
      projectsLoading: false,
      users: [],
      owner_id: null,
      ownersLoading: false,
      web_id: null,
      websLoading: false,
      kwInput: '',
      keyword: '',
      data: [],
      order_by: '',
      order_desc: '',
      // pagination
      pagesize: 10,
      page: 1,
      total: 0,
      addlinkDialogVisible: false,
      operate_item: {
        id: '',
        out_links: []
      },
      editKeywordPostDialog: false
    }
  },
  created() {
    this.project_id = getToken(ProjectKey)
    this.strategy_id = getToken(StrotegyKey)
    this.owner_id = getToken(OwnerKey)
    this.handleFetchProjects()
    this.handleFetchGetUsers()
    this.getList()
  },
  methods: {
    handleEditKeywordPost(i) {
      this.operate_item = i
      this.editKeywordPostDialog = true
    },
    addlink() {
      this.addlinkDialogVisible = true
    },
    handleAddLink() {
      if (this.temp_link.link === '') {
        return
      }
      if (this.operate_item.id) {
        const is_exist = this.operate_item.out_links.filter(item => item.link === this.temp_link.link)
        if (is_exist.length > 0) {
          return
        }
        this.operate_item.out_links.push(Object.assign({}, this.temp_link))
        this.addlinkDialogVisible = false
      } else {
        const is_exist = this.FormTemp.out_links.filter(item => item.link === this.temp_link.link)
        if (is_exist.length > 0) {
          return
        }
        this.FormTemp.out_links.push(Object.assign({}, this.temp_link))
        this.addlinkDialogVisible = false
      }
    },
    handleCleanTempOutLinks() {
      this.FormTemp.out_links = []
    },
    handleShowEdit(row) {
      row.modify = true
      console.log('set modify  true')
    },
    handleModifyKW(row) {
      row.mobile = false
      ModifyKeywordPost(row.id, row).then(response => {
        this.$message.success('修改成功')
        this.operate_item.id = ''
      }).catch(e => {
        this.$message.error(e)
        this.operate_item.id = ''
      })
    },
    handleAction(action, row) {
      this.action = action
      switch (action) {
        case 'create':
          this.resetTemp()
          this.title = '添加新关键词'
          this.operate_item.id = ''
          this.operate_item.out_links = []
          this.crawlkeywordDialogVisible = true
          break
        case 'delete':
          this.width = '30%'
          this.title = `确认要删除${row.keyword}?`
          this.FormTemp = Object.assign({}, row)
          this.crawlkeywordDialogVisible = true
          break
        case 'edit':
          this.width = '40%'
          this.title = `修改关键词${row.keyword}`
          this.FormTemp = Object.assign({}, row)
          this.FormTemp.keywords = row.keyword
          this.crawlkeywordDialogVisible = true
          break
      }
    },
    confirm() {
      switch (this.action) {
        case 'create':
          if (this.FormTemp.keywords === '') {
            alert('关键词不能为空')
            return
          }
          this.formloading = true
          Post(this.FormTemp
          ).then(response => {
            this.crawlkeywordDialogVisible = false
            this.getList()
            this.$message.success('添加成功')
            this.formloading = false
          })
          break
        case
          'delete'
          :
          this.formloading = true
          Delete(this.FormTemp.id).then((response) => {
            this.crawlkeywordDialogVisible = false
            this.getList()
            this.$message.success('删除成功')
            this.formloading = false
          })
          break
        case
          'edit'
          :
          this.formloading = true
          Put(this.FormTemp.id, this.FormTemp).then((response) => {
            this.crawlkeywordDialogVisible = false
            this.getList()
            this.$message.success('修改成功')
            this.formloading = false
          })
          break
      }
    },
    resetTemp() {
      this.FormTemp = {
        keywords: '',
        plantform: '',
        star: 1,
        out_links: [],
        wpaccount_id: this.wpaccount_id,
        default_fature_media_id: '',
        feature_image_url: '',
        id_of_associated_categories: ''
      }
    },
    handleAddNewKeyword() {
      this.title = '添加新关键词'
      this.FormTemp = {
        keywords: '',
        plantform: '',
        wpaccount_id: this.wpaccount_id,
        default_fature_media_id: '',
        feature_image_url: '',
        id_of_associated_categories: ''
      }
      this.crawlkeywordDialogVisible = true
    },
    handleFetchWebs() {
      this.websLoading = true
      GetWebs()
        .then(response => {
          this.websLoading = false
          this.webs = response.data.data
        })
        .catch(e => {
          this.websLoading = false
        })
    },
    handleFetchProjects() {
      this.projectsLoading = true
      GetProjects()
        .then(response => {
          this.projectsLoading = false
          this.projects = response.data.data
          if (this.projects.length) {
            this.project_id = getToken(ProjectKey) || null
          }
        })
        .catch(e => {
          this.projectsLoading = false
        })
    },
    notify(message, duration) {
      this.$notify({
        title: '成功',
        message: message,
        type: 'success',
        duration: duration || 2000
      })
    },
    handleFetchGetUsers() {
      this.ownersLoading = true
      GetUsers()
        .then(response => {
          this.ownersLoading = false
          this.users = response.data.data
          if (this.users.length) {
            this.owner_id = getToken(OwnerKey) || null
          }
        })
        .catch(e => {
          this.ownersLoading = false
        })
    },
    getList(loading) {
      if (loading === undefined) {
        loading = true
      }
      this.listLoading = loading
      GetCrawlKeyword(null, qs.stringify({
        kw: this.kwInput,
        keyword: this.keyword,
        tag: this.TagInput,
        is_finshed: this.is_finshed,
        pagesize: this.pagesize,
        page: this.page,
        order_by: this.order_by,
        order_desc: this.order_desc,
        owner_id: this.owner_id,
        project_id: this.project_id,
        wp_account_id: this.wp_account_id
      }))
        .then(response => {
          this.scrollTop()
          setToken(ProjectKey, this.project_id)
          setToken(StrotegyKey, this.strategy_id)
          setToken(OwnerKey, this.owner_id)
          setToken(TopicKeywordKey, this.keyword)

          this.data = response.data.data.map(m => {
            this.$set(m, 'active', false)
            return m
          })
          this.listLoading = false
          this.total = response.data.total
        }).catch(e => {
          this.listLoading = false
          setToken(ProjectKey, this.project_id)
          setToken(StrotegyKey, this.strategy_id)
          setToken(OwnerKey, this.owner_id)
          setToken(TopicKeywordKey, this.keyword)
        })
    },
    removeKeywords() {
      const new_keywords = []
      const o_keywords = this.FormTemp.keywords.split('\n')
      console.log(o_keywords)
      this.$prompt('最短单词数量', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消'
      }).then(({ value }) => {
        o_keywords.forEach(item => {
          if (item.split(' ').length >= value) {
            new_keywords.push(item)
          }
        })
        if (new_keywords.length > 0) {
          this.FormTemp.keywords = new_keywords.join('\n')
        }
      }).catch((error) => {
        console.log(error)
        this.$message({
          type: 'info',
          message: '取消输入'
        })
      })
    },
    handleAddKeywords() {
      if (this.FormTemp.keywords === '') {
        alert('关键词不能为空')
        return
      }
      if (this.FormTemp.id_of_associated_categories === '') {
        alert('必须填好目录ID')
        return
      }
      if (this.FormTemp.wpaccount_id === '') {
        alert('必须选择网站')
        return
      }
      Post(this.FormTemp).then(response => {
        this.notify('保存成功')
        this.getList()
        this.crawlkeywordDialogVisible = false
      }).catch(e => {
        this.notify('保存失败')
        this.crawlkeywordDialogVisible = false
      })
    },
    // pageSize 改变后触发 table 更新
    handleSizeChange(val) {
      this.pagesize = val
      this.getList()
    },
    // page 改变后触发 table 更新
    handlePageChange(val) {
      this.page = val
      this.getList()
    },
    changeWPAccount(v) {
      this.wp_account_id = v
    },
    changeTempWpAccount(v) {
      this.FormTemp.wpaccount_id = v
    },
    // 点击搜索
    handleSearch() {
      this.page = 1
      this.getList()
    },
    handleSelectionChange(rows) {
      if (rows.length === 0) {
        this.selected_rows = []
      }
      rows.forEach(row => {
        this.selected_rows.push(row)
      })
    },
    handleDeleteSelections() {
      this.selected_rows.forEach(row => {
        console.log(row)
        Put(row.id, { post_count: 0, id: row.id, is_finshed: false }).then((response) => {
          this.$message.success('修改成功')
        })
      })
      this.getList()
    },
    handleSort(v) {
      this.order_by = v.prop
      this.order_desc = orderMapper[v.order]
      this.getList()
    },
    scrollTop() {
      window.scrollTo(0, 0)
    }
  }
}
</script>

<style scoped>

.el-header, .el-footer {
  background-color: #fff;
  color: #333;
  text-align: left;
  line-height: 60px;
}

.el-aside {
  background-color: #fff;
  border-left: 1px solid #ebeef5;
  color: #333;
  padding-top: 20px;
  padding-left: 10px;
  line-height: 250px;
}

.el-main {
  background-color: #fff;
  color: #333;
  text-align: center;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

.el-tag + .el-tag {
  margin-left: 10px;
}

/*.top {*/
/*padding-left: 20px;*/
/*padding-right: 20px;*/
/*margin-bottom: 5px;*/
/*margin-top: 28px;*/
/*}*/

/*.head {*/
/*width: calc(20% - 70px);*/
/*}*/

/*.web {*/
/*margin-top: 10px;*/
/*margin-bottom: 10px;*/
/*display: inline-block;*/
/*width: 100%;*/
/*}*/

.web >>> .el-input {
  min-width: 1200px;
}

.app-container >>> .el-dialog {
  margin-top: 48px !important;
  margin-bottom: 68px;
}

.mt-detail:hover, .svg-icon:hover {
  cursor: pointer;
}

.mt-detail {
  color: #1976d2;
}

.mt-dialog >>> .el-dialog {
  margin: 88px auto !important;
}

.clearfix ::after {
  content: "";
  clear: both
}

.mt-table {
  color: black;
  padding: 20px;
}

.mt-pagination {
  float: right;
  margin-top: 10px;
}

.mt-top {
  margin: 15px 0;
}

.mt-row-btn {
  float: right;
  vertical-align: middle;
  color: white;
}

.mt-btn {
  background-color: rgba(0, 0, 0, 0);
  background-image: none;
  border-radius: 1000px;
  border-bottom-style: solid;
  border-bottom-width: 1px;
  border-collapse: collapse;
  border-image-outset: 0px;
  border-image-repeat: stretch;
  border-image-slice: 100%;
  border-image-source: none;
  border-image-width: 1;
  border-left-style: solid;
  border-left-width: 1px;
  border-right-style: solid;
  border-right-width: 1px;
  border-top-style: solid;
  border-top-width: 1px;
  box-sizing: border-box;
  color: #46be8a;
  cursor: pointer;
  display: block;
  float: right;
  font-family: "Helvetica Neue", Helvetica, Tahoma, Arial, "Microsoft Yahei", "Hiragino Sans GB", "WenQuanYi Micro Hei", sans-serif;
  font-size: 14px;
  font-weight: 400;
  height: 26px;
  hyphens: manual;
  line-height: 14px;
  margin-bottom: 0px;
  margin-right: 10px;
  padding: 5px;
  text-align: center;
  text-decoration-color: rgb(82, 96, 105);
  text-decoration-line: none;
  text-decoration-style: solid;
  text-rendering: optimizeLegibility;
  text-size-adjust: 100%;
  touch-action: manipulation;
  transition-delay: 0s, 0s, 0s, 0s;
  transition-duration: 0.2s, 0.2s, 0.2s, 0.2s;
  transition-property: border, color, width, background-color;
  transition-timing-function: linear, linear, linear, linear;
  user-select: none;
  vertical-align: middle;
  visibility: visible;
  white-space: nowrap;
  background: white;
}

.mt-btn:hover + >>> .mt-icon {
  color: #fff;
}

.mt-btn:hover {
  background: #46be8a;
}

.danger:hover {
  background-color: #F56C6C;
}

.danger {
  color: #F56C6C;
}

.default:hover {
  background-color: #62a8ea;
}

.default {
  color: #62a8ea;
}

.edit:hover {
  background-color: #909399;
}

.edit {
  color: #909399;
}

.mt-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: calc(100% - 220px);
  display: inline-block;
  vertical-align: middle;
}

.mt-row-btns {
  float: right;
  margin-right: 10px;
  z-index: 10000;
}

</style>
